package com.secf.service.action.hpy.hys.ListDir;

/**
 * @Author ms
 * @Date 2024-07-31 11:26
 */
public class Test4 {
    public static void main(String[] args) {
        int[][] twoDimArray = {
                {1, 2, 3},
                {4, 5, 6},
                {7, 8, 9}
        };

        // 访问二维数组的元素
        System.out.println("元素 [1][1]: " + twoDimArray[1][1]);

        // 遍历二维数组
        System.out.println("遍历二维数组:");
        for (int i = 0; i < twoDimArray.length; i++) {
            for (int j = 0; j < twoDimArray[i].length; j++) {
                System.out.print(twoDimArray[i][j] + " ");
            }
            System.out.println();
        }
    }
}